<!doctype html>
<html>
<head>
<#include "/admin/common/app.ftl">
<style type="text/css">
   body{ margin:0; padding:0; font-size:12px; font-family:"微软雅黑";}
   .head{ background:url($_basePath/img/bgx.png); background-position: 0 -720px;background-repeat: repeat-x; font-weight: bold; padding-left: 20px;color:#000; height:25px; line-height:25px; color:#FFF; font-size:14px;}
   .table01{ width:100%; }
   .admin{ width:100%; height:25px; border-bottom:1px solid #900; border-top:1px solid #900; text-indent:1.5em; line-height:25px; font-size:14px; font-style:italic; font-weight:bold;}
   </style>
</head>
	<body>
        <div style="height:20px;"></div>
        <table cellpadding="0" cellspacing="0" width="100%" border="0">
           <tr>
               <td width="4%"></td>
             <td width="12%" rowspan="5" valign="top"><img src="${basePath}/res/admin/tu01.jpg" width="107" height="114" /></td>
               <td width="37%" height="30">欢迎使用VIVA集成开发平台！</td>
               <td align="right" width="15%">操作系统版本：</td>
               <td width="32%"><span class="black">${info["os.name"]}</span></td>
           </tr>
           <tr>
             <td>&nbsp;</td>
             <td height="30">VIVA程序版本： VIVA 1.0.0-Snapshot </td>
             <td align="right" width="15%">操作系统类型：</td>
             <td><span class="black">${info["sun.cpu.isalist"]} ${info["sun.arch.data.model"]}位</span></td>
           </tr>
           <tr>
               <td>&nbsp;</td>
               <td height="30">
				剩余内存：<span style="color:#0078ff;">${sst2}MB</span>
				&nbsp;&nbsp;&nbsp;&nbsp;可使用内存：<span style="color:#ff8400;">${sst1}MB </span>
				&nbsp;&nbsp;&nbsp;&nbsp;最大内存：<span style="color:#00ac41;">${sst3}MB</span></td>
               <td align="right" width="15%">用户、目录、临时目录：</td>
               <td><span class="black">${info["user.home"]} ,${info["java.io.tmpdir"]}</span></td>
           </tr>
           <tr>
               <td>&nbsp;</td>
               <td height="30">
				数据库活动连接数：<span style="color:#0078ff;">${proxool.activeConnectionCount}</span>
				&nbsp;&nbsp;&nbsp;&nbsp;可使用连接：<span style="color:#ff8400;">${proxool.availableConnectionCount}</span>
				&nbsp;&nbsp;&nbsp;&nbsp;最大连接数：<span style="color:#00ac41;">${proxool.maximumConnectionCount}</span>
			   </td>
               <td align="right" width="15%">JAVA运行环境：</td>
               <td><span>${info["java.runtime.name"]} ${info["java.runtime.version"]}</span></td>
           </tr>
           <tr>
               <td>&nbsp;</td>
               <td height="30">
				线程总数：<span style="color:#0078ff;">${totalThread}</span>
				&nbsp;&nbsp;&nbsp;&nbsp;开机时间：${info["START_TIME"]}
			   </td>
               <td align="right" width="15%">JAVA虚拟机：</td>
               <td><span>${info["java.vm.name"]} ${info["java.vm.version"]}</span></td>
           </tr>
           <tr>
               <td>&nbsp;</td>
               <td height="30" colspan="3">
				${cached}
			   </td>
               <td>
				<a href="javascript:void(0);" onclick="clearFile();" >清理文件缓存</a>
				<a href="javascript:void(0);" onclick="clearCache();" >清理数据缓存</a>
			   </td>
           </tr>
           <tr>
               <td>&nbsp;</td>
               <td height="30" colspan="3">
				${info["jdbc.url"]}<br />
				${info["jdbc.username"]}
			   </td>
               <td>
			   </td>
           </tr>
        </table>
        <div style="height:30px;"></div>
        <div class="admin">
			<a href="javascript:void(0);" onclick="loadUser()">用户在线情况</a>
			|
			<a href="javascript:void(0);" onclick="loadThread()">请求线程占用情况</a>
			|
			<a href="javascript:void(0);" onclick="loadDb()">连接池占用情况</a>
			|
			<a href="javascript:void(0);" onclick="dbBak()">数据库备份</a>
			|
			<a href="javascript:void(0);" onclick="pictureLogo()">图片LOGO</a>
		</div>
		<div id="context"></div>
		<script >
			function loadUser(){
				$('#context').load("$_basePath/Sys!user.action?"+new Date().getTime());
			}	
			function loadThread(){
				$('#context').load("$_basePath/Sys!thread.action?"+new Date().getTime());
			}	
			function loadDb(){
				$('#context').load("$_basePath/Sys!db.action?"+new Date().getTime());
			}
			function dbBak(){
				$('#context').load("$_basePath/Sys!dbBak.action?"+new Date().getTime());
			}
			function pictureLogo(){
				$('#context').load("$_basePath/Sys!pictureLogo.action?"+new Date().getTime());
			}
			$(function(){
				$(".admin a").first().click();
			});
			function clearFile(){
				jQuery.ajax({
					url : "Sys!clearTemp.action",
					dataType : "json",
					success : function(json){
						if(json.flag){
							alert("完成");
							window.location.href=window.location.href;
						}else{
							alert(json.msg);
						}
					}
				});
			}
			
			function clearCache(){
				jQuery.ajax({
					url : "Sys!clearCache.action",
					dataType : "json",
					success : function(json){
						if(json.flag){
							alert("完成");
							window.location.href=window.location.href;
						}else{
							alert(json.msg);
						}
					}
				});
			}
			
			function clearFile(){
				jQuery.ajax({
					url : "Sys!clearTemp.action",
					dataType : "json",
					success : function(json){
						if(json.flag){
							alert("完成");
							window.location.href=window.location.href;
						}else{
							alert(json.msg);
						}
					}
				});
			}
			
			function clearCache(){
				jQuery.ajax({
					url : "Sys!clearCache.action",
					dataType : "json",
					success : function(json){
						if(json.flag){
							alert("完成");
							window.location.href=window.location.href;
						}else{
							alert(json.msg);
						}
					}
				});
			}
        </script>
	</body>
</html>